<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2020-06-05
 * Time: 16:36
 */

namespace app\api\model;


use think\model\concern\SoftDelete;

class HotelRoom extends BaseModel
{
    use SoftDelete;

    // 属于哪个酒店
    public function admin()
    {
        return $this->belongsTo('admin','admin_id');
    }

    // 属于哪个后台
    public function adminUser()
    {
        return $this->belongsTo('LinUser','lin_user_id','id');
    }

    // 图片列表
    public function imgs()
    {
        return $this->hasMany('HotelRoomImage','hotel_room_id');
    }

    // 基础信息
    public function basis()
    {
        return $this->hasMany('HotelRoomBasis','hotel_room_id');
    }

    // 标签
    public function tag()
    {
        return $this->hasMany('HotelRoomTag','hotel_room_id');
    }

    // 设施与服务
    public function facility()
    {
        return $this->hasMany('HotelRoomFacility','hotel_room_id');
    }

    // 入住要求
    public function claim()
    {
        return $this->hasMany('HotelRoomClaim','hotel_room_id');
    }
}